<?php

defined("ROOT_PATH") or define('ROOT_PATH', dirname(__FILE__) . '/../'); //定义ROOT_PATH
defined("HTML_PATH") or define('HTML_PATH', ROOT_PATH . "Html/"); //定义HTML_PATH
defined("ADMIN_PATH") or define("ADMIN_PATH", ROOT_PATH . "Admin/"); //定义ADMIN_PATH
defined("ADMIN_PATH_CORE") or define("ADMIN_PATH_CORE", ADMIN_PATH . "Core/"); //定义ADMIN_PATH_CORE
defined("ADMIN_PATH_CONF") or define("ADMIN_PATH_CONF", ADMIN_PATH . "Conf/"); //定义ADMIN_PATH_CONF
defined("LOGS_PATH") or define("LOGS_PATH", ADMIN_PATH . "Runtime/Logs/"); //定义ADMIN_PATH_LOGS
defined("PLATFORM") or define("PLATFORM", ROOT_PATH . "Platform/"); //定义PLATFORM
defined("CACHE") or define("CACHE", ADMIN_PATH . "Runtime/Cache/"); //缓存文件
defined("VOLT") or define("VOLT", ADMIN_PATH . "Runtime/Volt/"); //Volt文件
// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
define('APP_DEBUG', TRUE);

use Phalcon\Mvc\Application;

/**
 * 引入公共方法
 */
include_once PLATFORM . "/Common/function.php";


/**
 * 引入loader.php
 */
include_once ADMIN_PATH_CORE . 'loader.php';

include ADMIN_PATH_CORE . 'routers.php';

/**
 * 引入services.php
 */
include ADMIN_PATH_CORE . 'services.php';

/**
 * 设置公共异常处理方法
 */
set_exception_handler('Admin\Controllers\BaseController::appException');

$application = new Application($di);

// 处理请求
$response = $application->handle();

$response->send();




